IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spLetterHeaderAndFooter_Create')
	BEGIN
		PRINT 'Dropping Procedure spLetterHeaderAndFooter_Create'
		DROP  Procedure  spLetterHeaderAndFooter_Create
	END

GO

PRINT 'Creating Procedure spLetterHeaderAndFooter_Create'
GO
CREATE Procedure dbo.spLetterHeaderAndFooter_Create
	( 	  
		@HeaderFontSize decimal, 
		@HeaderFontStyle varchar(50), 
		@HeaderText varchar(500), 
		@HeaderImagePath varchar(50), 
		@FooterFont varchar(50), 
		@FooterFontSize decimal, 
		@FooterFontStyle varchar(50), 
		@FooterText varchar(500)
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 10/23/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO LetterHeaderAndFooter
	  (
			HeaderFontSize,
			HeaderFontStyle,
			HeaderText,
			HeaderImagePath,
			FooterFont,
			FooterFontSize,
			FooterFontStyle,
			FooterText	  
	  )
	VALUES
	  (
			@HeaderFontSize,
			@HeaderFontStyle,
			@HeaderText,
			@HeaderImagePath,
			@FooterFont,
			@FooterFontSize,
			@FooterFontStyle,
			@FooterText
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spLetterHeaderAndFooter_Create: Unable to Insert a new LetterHeaderAndFooter', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'LetterHeaderAndFooter_ID'

	-- Return to calling method
	RETURN 

GO
